package com.malamute.core.common;

import java.util.List;

/**
 * @Title:Page.java
 * @Package com.malamute.core.common
 * @Description 分页对象
 * @author AceGuan gjybst@163.com
 * @date 2012-1-4 下午01:57:28
 * @version v1.0
 */
public class Page {
	private int startPageNum = 0;// 起始页面
	private int totalPageNum = 0;// 总共页面
	private long totalNum = 0;// 总条数
	private int currentPageNum = 0;// 当前页面
	private int pageSize = 10;// 每页条数
	private List list;// 查询内容封装
	public static final int SHOWPAGESIZE = 5;// << 1,2,3,4,5 ... >>

	/**
	 * 获取startPageNum
	 * 
	 * @return startPageNum
	 */

	public int getStartPageNum() {
		return startPageNum;
	}

	/**
	 * 设置startPageNum
	 * 
	 * @param startPageNum
	 */
	public void setStartPageNum(int startPageNum) {
		this.startPageNum = startPageNum;
	}

	/**
	 * 获取totalPageNum
	 * 
	 * @return totalPageNum
	 */

	public int getTotalPageNum() {
		if (this.getTotalNum() > 0) {
			int flag;
			flag = (int) this.getTotalNum() % this.getPageSize();
			if (flag >= 1) {
				this.totalPageNum = (int) this.getTotalNum()
						/ this.getPageSize() + 1;
			}else{
				this.totalPageNum = (int) this.getTotalNum() / this.getPageSize();
			}
		}
		return totalPageNum;
	}

	/**
	 * 设置totalPageNum
	 * 
	 * @param totalPageNum
	 */
	public void setTotalPageNum(int totalPageNum) {
		this.totalPageNum = totalPageNum;
	}

	/**
	 * 获取currentPageNum
	 * 
	 * @return currentPageNum
	 */

	public int getCurrentPageNum() {
		return currentPageNum;
	}

	/**
	 * 设置currentPageNum
	 * 
	 * @param currentPageNum
	 */
	public void setCurrentPageNum(int currentPageNum) {
		this.currentPageNum = currentPageNum;
	}

	/**
	 * 获取pageSize
	 * 
	 * @return pageSize
	 */

	public int getPageSize() {
		return pageSize;
	}

	/**
	 * 设置pageSize
	 * 
	 * @param pageSize
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	/**
	 * 获取list
	 * 
	 * @return list
	 */

	public List getList() {
		return list;
	}

	/**
	 * 设置list
	 * 
	 * @param list
	 */
	public void setList(List list) {
		this.list = list;
	}

	/**
	 * 获取totalNum
	 * 
	 * @return totalNum
	 */

	public long getTotalNum() {
		return totalNum;
	}

	/**
	 * 设置totalNum
	 * 
	 * @param totalNum
	 */
	public void setTotalNum(long totalNum) {
		this.totalNum = totalNum;
	}

}
